#ifndef triangle_v2_h
#define triangle_v2_h

#include <stdint.h>
#include <GLFW/glfw3.h>

class TriangleV2 {

private:
    static const float vertices[9];

    const char *vertex_shader_code = "#version 330 core\n"
        "layout (location = 0) in vec3 aPos;\n"
        "void main()\n"
        "{\n"
        "   gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
        "}\0";

    const char *fragment_shader_code = "#version 330 core\n"
        "out vec4 FragColor;\n"
        "uniform vec4 ourColor;\n"
        "void main()\n"
        "{\n"
        "   FragColor = ourColor;\n"
        "}\n\0";

    int mProgram;

    uint32_t VBO;

    uint32_t VAO;

    int createShader(int, const char*);

    int createProgram();

public:

    bool init();

    void drawSelf(GLFWwindow*);

    void destroy();
};

#endif /* triangle_v2_h */
